using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ObjectMapper.Benchmark.DataModel
{
    internal class SpecialOfferProductConfiguration : EntityTypeConfiguration<SpecialOfferProduct>
    {
        public SpecialOfferProductConfiguration()
        {
            ToTable("Sales.SpecialOfferProduct");
            HasKey(x => new {x.SpecialOfferId, x.ProductId});

            Property(x => x.SpecialOfferId)
                .HasColumnName("SpecialOfferID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.ProductId)
                .HasColumnName("ProductID")
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);
            Property(x => x.Rowguid).HasColumnName("rowguid").IsRequired();
            Property(x => x.ModifiedDate).HasColumnName("ModifiedDate").IsRequired();
        }
    }
}